package cn.jhc;

import java.io.IOException;

import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.HttpVersion;
import org.apache.http.message.BasicHttpEntityEnclosingRequest;
import org.apache.http.protocol.HttpContext;
import org.apache.http.protocol.HttpRequestHandler;

public class SubmitHandler implements HttpRequestHandler {

    @Override
    public void handle(HttpRequest request, HttpResponse response, HttpContext context)
            throws HttpException, IOException {
        // TODO Auto-generated method stub
        BasicHttpEntityEnclosingRequest req = (BasicHttpEntityEnclosingRequest) request;
        req.getEntity().writeTo(System.out);
        System.out.println();
        System.out.println();
        response.setStatusLine(new HttpVersion(1, 1), HttpStatus.SC_OK);

    }
    
}
